package org.jeecg.modules.basic.entry.util;

import static org.jeecg.modules.basic.entry.util.StringUtil.getMD5;

//设备配置：因济宁学院私有云与公有云接口不同，数据订阅中没有方向字段，只能在此写死，数据源是商汤的数据库device表
public class SenseTimeToDevice {


	public static String getDirection(String code) {
		String direction="";
		switch(code){
			case "SPSX-d96b3449073f6168d7f73c7c4b1223dc":direction = "1"; break;//84
//			case "SPSX-34aeff6b7a58612f57b98351022610fd":direction = "1"; break;
			case "SPSX-9fabd3069b23f13c41e45e353427b5c5":direction = "1"; break;//83
			case "SPSX-7eb3bead07c41a6e88851db0d3a4c0a6":direction = "1"; break;//82
			case "SPSX-5e1e6eb1bbc076810d35dad04d975382":direction = "1"; break;//81
			case "SPSX-ec23857f0d5cef8eb544f8619ed30638":direction = "2"; break;//88
			case "SPSX-08e59be13ca33736b7cbef64e23d9c01":direction = "2"; break;//85
			case "SPSX-3845ddb14607a95883e491f88b90d00b":direction = "2"; break;//87
			case "SPSX-cd65b6e5702dc86f03628e83f6981add":direction = "2"; break;//86
			case "SPSX-2c5f2d9c10982ee4642750873b47b10e":direction = "1"; break;//91
			case "SPSX-346232459e25aac20d85424e4e47a90e":direction = "1"; break;//92
			case "SPSX-f7469c45b78615833e38cc948b38b920":direction = "1"; break;//93
			case "SPSX-1b19d3042da9b035175b25093b335530":direction = "2"; break;//95
			case "SPSX-407dc65e54397e161152b092146ca4f9":direction = "2"; break;//98
			case "SPSX-4515c6757883449cb172932fcfeabcbc":direction = "2"; break;//96
			case "SPSX-2debf90c12767e58c4a3c69f08eced01":direction = "2"; break;//97
			case "SPSX-8322941e60e9b044a134b98f3612441a":direction = "1"; break;//64
			case "SPSX-d14269aba8d4fa9c8add868aaba3dfd7":direction = "1"; break;//63
			case "SPSX-8adc831575d7f11c226ae50e16d29641":direction = "1"; break;//62
			case "SPSX-50b98a62fd5fd3f6c1d0a5e91ac80762":direction = "2"; break;//65
			case "SPSX-beb1f5704524b50b3c445c4c1e5acb77":direction = "2"; break;//66
			case "SPSX-9735fb7f18d03298633c8da2d62d75d1":direction = "2"; break;//67
			case "SPSX-c22d078f5bbaf7e5180188d2256f2b8f":direction = "1"; break;//61
			case "SPSX-70c4dbd3b3c3225d7fffb31bc4765a53":direction = "1"; break;//94
			case "SPSX-aadd3666eca92e9509d69f5e00bf5380":direction = "2"; break;//78
			case "SPSX-5cd12631494f6902d1a76d95f14890d6":direction = "2"; break;//77
			case "SPSX-23c5e0c882893b4e8b5e75cfe96ee302":direction = "2"; break;//76
			case "SPSX-4c688e754ea8c126f5ccab3f68c58796":direction = "2"; break;//75
			case "SPSX-2e2419f88c9d845e8d85ce00b3902799":direction = "1"; break;//71
			case "SPSX-85bbeed7b330aea498eff248dca95b37":direction = "1"; break;//73
			case "SPSX-6ab214d6f6a2891f47747a33add3b3e9":direction = "1"; break;//74
			case "SPSX-a85686b83c745b2f89f389d6a7de5b0d":direction = "1"; break;//72
			case "SPSX-ab4e82034e95fc2b51f1ca287afaca54":direction = "1"; break;//173
			case "SPSX-762b60995c613bd3835cb9ce92cbc635":direction = "1"; break;//171
			case "SPSX-e0a451a3c2a6f5a452b49873378513d1":direction = "1"; break;//174
			case "SPSX-62574139186b70c8b595916945f8f6d2":direction = "1"; break;//172
			case "SPSX-607a3ec1a40eb66ce445344f2bc85750":direction = "2"; break;//178
			case "SPSX-568981d1fa8cf2afc5d86b1843ebefb1":direction = "2"; break;//175
			case "SPSX-d1e9ce08b2bd365f265dcc7266f51fc1":direction = "2"; break;//177
			case "SPSX-b266eaa1d395586d6793715229f1cf5e":direction = "2"; break;//176
			case "SPSX-ea6a003e40fbb3ec0fcb11cd5c1921c4":direction = "2"; break;//68
			case "SPSX-500d2d32ebc870bb7941d306c2583b25":direction = "1"; break;//211
			case "SPSX-9f4a4b33ce79087ee68f471a996e4d9b":direction = "1"; break;//212
			case "SPSX-47f8f25a3da6bb79f12f49546deaf753":direction = "1"; break;//213
			case "SPSX-c4db677353f1da2a084efc1cba7b7db5":direction = "2"; break;//214
			case "SPSX-a4f75e1eae38fb5f6c9ff5f235456344":direction = "2"; break;//215
			case "SPSX-800aac8b884fee17037ec98b3cb7bf60":direction = "2"; break;//216
			case "SPSX-4bd5dd44110fd9184922ca98f08a0bf5":direction = "1"; break;//218
			case "SPSX-b942a18cfe2f782750bacdbce240fa73":direction = "2"; break;//217

			default    :direction = "0"; break;
		}
		return direction;
	}

	public static String getLocation(String code) {
		String location="";
		switch(code){
			case "SPSX-d96b3449073f6168d7f73c7c4b1223dc":location = "8A"; break;//84
//			case "SPSX-34aeff6b7a58612f57b98351022610fd":location = "8A"; break;
			case "SPSX-9fabd3069b23f13c41e45e353427b5c5":location = "8A"; break;//83
			case "SPSX-7eb3bead07c41a6e88851db0d3a4c0a6":location = "8A"; break;//82
			case "SPSX-5e1e6eb1bbc076810d35dad04d975382":location = "8A"; break;//81
			case "SPSX-ec23857f0d5cef8eb544f8619ed30638":location = "8A"; break;//88
			case "SPSX-08e59be13ca33736b7cbef64e23d9c01":location = "8A"; break;//85
			case "SPSX-3845ddb14607a95883e491f88b90d00b":location = "8A"; break;//87
			case "SPSX-cd65b6e5702dc86f03628e83f6981add":location = "8A"; break;//86
			case "SPSX-2c5f2d9c10982ee4642750873b47b10e":location = "8B"; break;//91
			case "SPSX-346232459e25aac20d85424e4e47a90e":location = "8B"; break;//92
			case "SPSX-f7469c45b78615833e38cc948b38b920":location = "8B"; break;//93
			case "SPSX-1b19d3042da9b035175b25093b335530":location = "8B"; break;//95
			case "SPSX-407dc65e54397e161152b092146ca4f9":location = "8B"; break;//98
			case "SPSX-4515c6757883449cb172932fcfeabcbc":location = "8B"; break;//96
			case "SPSX-2debf90c12767e58c4a3c69f08eced01":location = "8B"; break;//97
			case "SPSX-8322941e60e9b044a134b98f3612441a":location = "6"; break;//64
			case "SPSX-d14269aba8d4fa9c8add868aaba3dfd7":location = "6"; break;//63
			case "SPSX-8adc831575d7f11c226ae50e16d29641":location = "6"; break;//62
			case "SPSX-50b98a62fd5fd3f6c1d0a5e91ac80762":location = "6"; break;//65
			case "SPSX-beb1f5704524b50b3c445c4c1e5acb77":location = "6"; break;//66
			case "SPSX-9735fb7f18d03298633c8da2d62d75d1":location = "6"; break;//67
			case "SPSX-c22d078f5bbaf7e5180188d2256f2b8f":location = "6B"; break;//61
			case "SPSX-70c4dbd3b3c3225d7fffb31bc4765a53":location = "8B"; break;//94
			case "SPSX-aadd3666eca92e9509d69f5e00bf5380":location = "7A"; break;//78
			case "SPSX-5cd12631494f6902d1a76d95f14890d6":location = "7A"; break;//77
			case "SPSX-23c5e0c882893b4e8b5e75cfe96ee302":location = "7A"; break;//76
			case "SPSX-4c688e754ea8c126f5ccab3f68c58796":location = "7A"; break;//75
			case "SPSX-2e2419f88c9d845e8d85ce00b3902799":location = "7A"; break;//71
			case "SPSX-85bbeed7b330aea498eff248dca95b37":location = "7A"; break;//73
			case "SPSX-6ab214d6f6a2891f47747a33add3b3e9":location = "7A"; break;//74
			case "SPSX-a85686b83c745b2f89f389d6a7de5b0d":location = "7A"; break;//72
			case "SPSX-ab4e82034e95fc2b51f1ca287afaca54":location = "7B"; break;//173
			case "SPSX-762b60995c613bd3835cb9ce92cbc635":location = "7B"; break;//171
			case "SPSX-e0a451a3c2a6f5a452b49873378513d1":location = "7B"; break;//174
			case "SPSX-62574139186b70c8b595916945f8f6d2":location = "7B"; break;//172
			case "SPSX-607a3ec1a40eb66ce445344f2bc85750":location = "7B"; break;//178
			case "SPSX-568981d1fa8cf2afc5d86b1843ebefb1":location = "7B"; break;//175
			case "SPSX-d1e9ce08b2bd365f265dcc7266f51fc1":location = "7B"; break;//177
			case "SPSX-b266eaa1d395586d6793715229f1cf5e":location = "7B"; break;//176
			case "SPSX-ea6a003e40fbb3ec0fcb11cd5c1921c4":location = "6"; break;//68
			case "SPSX-500d2d32ebc870bb7941d306c2583b25":location = "C1"; break;//211
			case "SPSX-9f4a4b33ce79087ee68f471a996e4d9b":location = "C1"; break;//212
			case "SPSX-47f8f25a3da6bb79f12f49546deaf753":location = "C1"; break;//213
			case "SPSX-c4db677353f1da2a084efc1cba7b7db5":location = "C1"; break;//214
			case "SPSX-a4f75e1eae38fb5f6c9ff5f235456344":location = "C1"; break;//215
			case "SPSX-800aac8b884fee17037ec98b3cb7bf60":location = "C1"; break;//216
			case "SPSX-4bd5dd44110fd9184922ca98f08a0bf5":location = "C3"; break;//218
			case "SPSX-b942a18cfe2f782750bacdbce240fa73":location = "C3"; break;//217

			default    :location = "0"; break;
		}
		return location;
	}
	//将楼名转换成电控系统识别的楼号
	public static String getLhCode(String lhname) {
		String location="";
		switch(lhname){
			case "新6号楼":location = "66"; break;
			case "新7号楼A座":location = "7"; break;
			case "新7号楼B座":location = "77"; break;
			case "新8号楼A座":location = "81"; break;
			case "新8号楼座":location = "82"; break;
			default    :location = "0"; break;
		}
		return location;
	}

	/**
	 * 通过门锁的ip与面板机器设备比对
	 * */
	public static String getDoorLocation(String code) {
		String location="";
		switch(code){
			case "192.168.0.122":location = "SPSX-d96b3449073f6168d7f73c7c4b1223dc"; break;//8A
	/*		case "SPSX-34aeff6b7a58612f57b98351022610fd":location = "SPSX-34aeff6b7a58612f57b98351022610fd"; break;//8A
			case "SPSX-7eb3bead07c41a6e88851db0d3a4c0a6":location = "SPSX-7eb3bead07c41a6e88851db0d3a4c0a6"; break;//8A
			case "SPSX-5e1e6eb1bbc076810d35dad04d975382":location = "SPSX-5e1e6eb1bbc076810d35dad04d975382"; break;//8A
			case "SPSX-ec23857f0d5cef8eb544f8619ed30638":location = "SPSX-ec23857f0d5cef8eb544f8619ed30638"; break;//8A
			case "SPSX-08e59be13ca33736b7cbef64e23d9c01":location = "SPSX-08e59be13ca33736b7cbef64e23d9c01"; break;//8A
			case "SPSX-3845ddb14607a95883e491f88b90d00b":location = "SPSX-3845ddb14607a95883e491f88b90d00b"; break;//8A
			case "SPSX-cd65b6e5702dc86f03628e83f6981add":location = "SPSX-cd65b6e5702dc86f03628e83f6981add"; break;//8A
			case "SPSX-2c5f2d9c10982ee4642750873b47b10e":location = "SPSX-2c5f2d9c10982ee4642750873b47b10e"; break;//8B
			case "SPSX-346232459e25aac20d85424e4e47a90e":location = "SPSX-346232459e25aac20d85424e4e47a90e"; break;//8B
			case "SPSX-f7469c45b78615833e38cc948b38b920":location = "SPSX-f7469c45b78615833e38cc948b38b920"; break;//8B
			case "SPSX-1b19d3042da9b035175b25093b335530":location = "SPSX-1b19d3042da9b035175b25093b335530"; break;//8B
			case "SPSX-407dc65e54397e161152b092146ca4f9":location = "SPSX-407dc65e54397e161152b092146ca4f9"; break;//8B
			case "SPSX-4515c6757883449cb172932fcfeabcbc":location = "SPSX-4515c6757883449cb172932fcfeabcbc"; break;//8B
			case "SPSX-2debf90c12767e58c4a3c69f08eced01":location = "SPSX-2debf90c12767e58c4a3c69f08eced01"; break;//8B
			case "SPSX-8322941e60e9b044a134b98f3612441a":location = "SPSX-8322941e60e9b044a134b98f3612441a"; break;//66
			case "SPSX-d14269aba8d4fa9c8add868aaba3dfd7":location = "SPSX-d14269aba8d4fa9c8add868aaba3dfd7"; break;//6
			case "SPSX-8adc831575d7f11c226ae50e16d29641":location = "SPSX-8adc831575d7f11c226ae50e16d29641"; break;//6
			case "SPSX-50b98a62fd5fd3f6c1d0a5e91ac80762":location = "SPSX-50b98a62fd5fd3f6c1d0a5e91ac80762"; break;//6
			case "SPSX-beb1f5704524b50b3c445c4c1e5acb77":location = "SPSX-beb1f5704524b50b3c445c4c1e5acb77"; break;//6
			case "SPSX-9735fb7f18d03298633c8da2d62d75d1":location = "SPSX-9735fb7f18d03298633c8da2d62d75d1"; break;//6
			case "SPSX-c22d078f5bbaf7e5180188d2256f2b8f":location = "SPSX-c22d078f5bbaf7e5180188d2256f2b8f"; break;//6B
			case "SPSX-70c4dbd3b3c3225d7fffb31bc4765a53":location = "SPSX-70c4dbd3b3c3225d7fffb31bc4765a53"; break;//8B
			case "SPSX-aadd3666eca92e9509d69f5e00bf5380":location = "PSX-aadd3666eca92e9509d69f5e00bf5380"; break;//7A
			case "SPSX-5cd12631494f6902d1a76d95f14890d6":location = "SPSX-5cd12631494f6902d1a76d95f14890d6"; break;//7A
			case "SPSX-23c5e0c882893b4e8b5e75cfe96ee302":location = "SPSX-23c5e0c882893b4e8b5e75cfe96ee302"; break;//7A
			case "SPSX-4c688e754ea8c126f5ccab3f68c58796":location = "SPSX-4c688e754ea8c126f5ccab3f68c58796"; break;//7A
			case "SPSX-2e2419f88c9d845e8d85ce00b3902799":location = "SPSX-2e2419f88c9d845e8d85ce00b3902799"; break;//7A
			case "SPSX-85bbeed7b330aea498eff248dca95b37":location = "SPSX-85bbeed7b330aea498eff248dca95b37"; break;//7A
			case "SPSX-6ab214d6f6a2891f47747a33add3b3e9":location = "SPSX-6ab214d6f6a2891f47747a33add3b3e9"; break;//7A
			case "SPSX-a85686b83c745b2f89f389d6a7de5b0d":location = "SPSX-a85686b83c745b2f89f389d6a7de5b0d"; break;//7A
			case "SPSX-ab4e82034e95fc2b51f1ca287afaca54":location = "SPSX-ab4e82034e95fc2b51f1ca287afaca54"; break;//7B
			case "SPSX-762b60995c613bd3835cb9ce92cbc635":location = "SPSX-762b60995c613bd3835cb9ce92cbc635"; break;//7B
			case "SPSX-e0a451a3c2a6f5a452b49873378513d1":location = "SPSX-e0a451a3c2a6f5a452b49873378513d1"; break;//7B
			case "SPSX-62574139186b70c8b595916945f8f6d2":location = "SPSX-62574139186b70c8b595916945f8f6d2"; break;//7B
			case "SPSX-607a3ec1a40eb66ce445344f2bc85750":location = "SPSX-607a3ec1a40eb66ce445344f2bc85750"; break;//7B
			case "SPSX-568981d1fa8cf2afc5d86b1843ebefb1":location = "SPSX-568981d1fa8cf2afc5d86b1843ebefb1"; break;//7B
			case "SPSX-d1e9ce08b2bd365f265dcc7266f51fc1":location = "SPSX-d1e9ce08b2bd365f265dcc7266f51fc1"; break;//7B
			case "SPSX-b266eaa1d395586d6793715229f1cf5e":location = "SPSX-b266eaa1d395586d6793715229f1cf5e"; break;//7B
			case "SPSX-ea6a003e40fbb3ec0fcb11cd5c1921c4":location = "SPSX-ea6a003e40fbb3ec0fcb11cd5c1921c4"; break;//6
*/
			default    :location = ""; break;
		}
		return location;
	}


	/**
	 * 通过时间指令获取备注
	 * */
	public static String getRemark(String code) {
		String remark="";
		switch(code){
			case "0x02":remark = "通行记录"; break;
			case "02":remark = "通行记录"; break;
			case "0x03":remark = "异常事件记录"; break;
			case "03":remark = "异常事件记录"; break;
			case "0x04":remark = "报警记录"; break;
			case "04":remark = "报警记录"; break;
			case "0x05":remark = "模式更改记录"; break;
			case "05":remark = "模式更改记录"; break;
			default    :remark = ""; break;
		}
		return remark;
	}


	/**
	 * 通行事件来源
	 * */
	public static String getTransitSource(String code) {
		String remark="";
		switch(code){
			case "0x01":remark = "左向刷卡"; break;
			case "0x02":remark = "右向刷卡"; break;
			case "0x03":remark = "左向通行"; break;
			case "0x04":remark = "右向通行"; break;
			case "0x05":remark = "左向等待超时"; break;
			case "0x06":remark = "右向等待超时"; break;
			case "01":remark = "左向刷卡"; break;
			case "02":remark = "右向刷卡"; break;
			case "03":remark = "左向通行"; break;
			case "04":remark = "右向通行"; break;
			case "05":remark = "左向等待超时"; break;
			case "06":remark = "右向等待超时"; break;
			default    :remark = ""; break;
		}
		return remark;
	}
	/**
	 * 报警事件来源
	 * */
	public static String getAlarmSource(String code) {
		String remark="";
		switch(code){
			case "0x01":remark = "左闯入报警"; break;
			case "0x02":remark = "右闯入报警"; break;
			case "0x03":remark = "左尾随报警"; break;
			case "0x04":remark = "右尾随报警"; break;
			case "0x05":remark = "左滞留报警"; break;
			case "0x06":remark = "右滞留报警"; break;
			case "0x07":remark = "左潜回报警"; break;
			case "0x08":remark = "右潜回报警"; break;
			case "0x09":remark = "挡板运行阻挡"; break;
			case "0x0A":remark = "暴力闯闸"; break;
			case "0x0B":remark = "停机强推"; break;
			case "01":remark = "左向刷卡"; break;
			case "02":remark = "右向刷卡"; break;
			case "03":remark = "左向通行"; break;
			case "04":remark = "右向通行"; break;
			case "05":remark = "左向等待超时"; break;
			case "06":remark = "右向等待超时"; break;
			case "07":remark = "左潜回报警"; break;
			case "08":remark = "右潜回报警"; break;
			case "09":remark = "挡板运行阻挡"; break;
			case "0A":remark = "暴力闯闸"; break;
			case "0B":remark = "停机强推"; break;
			default    :remark = ""; break;
		}
		return remark;
	}
}

